<div class="el-dialog__header">
    <button type="button" data-dismiss="modal" aria-hidden="true" aria-label="Close" class="el-dialog__headerbtn"><i
            class="el-dialog__close el-icon el-icon-close"></i></button>
    <h4 class="modal-title">${msg['index.user.mode']}</h4>
</div>
<div class="modal-body">
    <form id="modeForm" role="form" class="form-horizontal parsley-form" method="post">
        <div class="row" style="padding-top: 10px;">
            <div class="col-lg-12">
                <div class="form">
                    <div class="col-sm-8">
                        <input name="mode" value="true" type="radio"
                        <!--#if(@shiro.getPrincipalProperty('loginPjax')){#-->checked<!--#}#--> > PJAX加载方式<br>优点：占用带宽少，加载速度快；<br>缺点：不能使用浏览器前进、后退功能。
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top: 10px;">
            <div class="col-lg-12">
                <div class="form">
                    <div class="col-sm-8">
                        <input name="mode" value="false" type="radio"
                        <!--#if(!@shiro.getPrincipalProperty('loginPjax')){#-->checked<!--#}#--> > 传统加载方式<br>优点：可以使用浏览器的前进、后退功能；<br>缺点：页面会重载、刷新，占用带宽大。
                    </div>
                </div>
            </div>
        </div>

    </form>
</div>
<div class="el-dialog__footer">
        <span class="dialog-footer">
            <button type="button" class="el-button el-button--default" data-dismiss="modal">
                <span>${msg['system.cancel']}</span>
            </button>
            <button type="button" class="el-button el-button--primary" id="okMode">
                <span>${msg['system.confirm']}</span>
            </button>
        </span>
</div>
<script type="text/javascript">
    $(function () {
        $("#okMode").on("click", function () {
            $.post("${base}/platform/sys/user/modeDo", {mode: $("input[type='radio'][name='mode']:checked").val()}, function (data) {
                if (data.code == 0) {
                    $('#homeDetail').modal('hide');
                    ELEMENT.Message({
                        message: data.msg,
                        type: 'success'
                    });
                } else {
                    ELEMENT.Message({
                        message: data.msg,
                        type: 'error'
                    });
                }
            }, "json");
        });
    });
</script>
